package com.cll.learn.provider1.service.impl;

import com.cll.learn.api.service.DemoService;
import com.cll.learn.filter.DubboTraffic;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2020/10/9 10:32
 */
@DubboService(interfaceClass = DemoService.class, version = "1.1.0")
@Component
public class DemoServiceImpl implements DemoService {

    @Override
    public String sayHello(String param) {
        System.out.println("provider1 receive param = " + param);
        String requestIp = DubboTraffic.getRequestIp();
        System.out.println("ip = " + requestIp);
        return "你好，我是provider1。你的IP是：" + requestIp;
    }
}
